package com.freez.spark.tool;

import scala.Tuple2;
import scala.Tuple3;
import scala.Tuple7;

import java.io.Serializable;

/**
 * FileName: TupleUtils.java
 * Author:   zcs
 * Date:     10/29/21 2:07 PM
 * Description: 自定义Tuple工具类
 */
public class TupleUtils implements Serializable {
        
    /**
     * 自定义Tuple2
     */
    public static final <A, B> Tuple2<A, B> T2(A a, B b) {
        return new Tuple2<A, B>(a, b);
    }
    /**
     * 自定义Tuple3
     */
    public static final <A, B, C> Tuple3<A, B, C> T3(A a, B b, C c) {
        return new Tuple3<A, B, C>(a, b, c);
    }

    /**
     * 自定义Tuple7
     */
    public static final <A, B, C, D, E, F, G> Tuple7<A, B, C, D, E, F, G> T7(A a, B b, C c, D d, E e, F f, G g) {
        return new Tuple7<A, B, C, D, E, F, G>(a, b, c, d, e, f, g);
    }
}
